$(document).ready(function(){
    $("#login_button").click(function(){
        $("#popup").show();
        $('#name').focus();
    });

    $("#enviar_arquivo").click(function(){
        $("#popup").show();
        $("#uploadform").show();
    });
     
    horizontal();
    abrir();
});

function horizontal() {
 
        var navItems = document.getElementById("menu_dropdown").getElementsByTagName("li");
	
        for (var i=0; i< navItems.length; i++) {
            if(navItems[i].className == "submenu")
            {
                if(navItems[i].getElementsByTagName('ul')[0] != null)
                {
                    navItems[i].onmouseover=function() {
                        this.getElementsByTagName('ul')[0].style.display="block";
                        this.style.backgroundColor = "#f9f9f9";
                    }
                    navItems[i].onmouseout=function() {
                        this.getElementsByTagName('ul')[0].style.display="none";
                        this.style.backgroundColor = "#FFFFFF";
                    }
                }
            }
        }
    }
	
    // Fun��o que fecha o pop-up ao clicar no link fechar
    function fechar(){
        document.getElementById('notifica').style.display = 'none';
    }

    // Aqui definimos o tempo para fechar o pop-up
    function abrir(){
        document.getElementById('notifica').style.display = 'block';
        setTimeout ("fechar()", 6000);
    }

    function valida(edit){
        if(event.keyCode<48 || event.keyCode>57) event.returnValue=false;
        if(edit.value.length==2 || edit.value.length==5) edit.value+="/";
    }